// -----------------------------------------------------------------------------
// WEB B
// jscom group for member_3d
// -----------------------------------------------------------------------------

// show table data
$.fn.showTableData = function(rdata,tbdId,disk,_gametype,palygroup, bettypeStr){
  var dataLen = rdata.number.length;
  var appToTbdr = "tbody#tbdr"+tbdId+" tr";
  var urlPre = "";
  var hrefStr = ""; 
  var trNum = $(appToTbdr).size();
  var tempTr = 0;
  bettypeStr = "" + bettypeStr;
  if(bettypeStr.indexOf("_") > 0){ var bettypeArr = bettypeStr.split("_"); }
  else{ var bettypeArr = [bettypeStr, 0]; }
  var bettype = bettypeArr[0];
  var subid = 0;
  if(bettypeArr.length > 1){ subid = bettypeArr[1]; }  
  $(appToTbdr).empty(); 
  urlPre = "op.php?op=member_3d&fp=bet_fast&gametype=" + _gametype + "&disk=" + disk + "&palygroup=" + palygroup + "&bettype=" + bettype + "&subid=" + subid;
  for(i = 0; i < dataLen; i++){
    if(rdata.rates[i] == undefined){rdata.rates[i] = 0;}
    hrefStr = urlPre + "&num=" + rdata.number[i] + "&rate=" + rdata.rates[i];
    tempTr = i % trNum;
    $('<th class="title02_3d" width="35">' + rdata.number[i] + '</th><td class="betnum" width="35"><a href="'+hrefStr+'" class="betRateNum" target="leftFrame">'+rdata.rates[i]+'</a></td><td><input type="text" size="3" name="'+tbdId+'_'+rdata.number[i]+'" /></td>').appendTo(appToTbdr+":eq("+tempTr+")");
  }
};

// show teable data two face
$.fn.showTabelDataTwoFace = function(rdata,tbdId,disk,_gametype,palygroup,bettypeStr){
  var dataLen = rdata.number.length;
  var tbd = "table#" + tbdId;
  var r2aType = 0;
  if(palygroup == "r2a"){
    r2aType = $("input[name='radShowAreaType']:checked").val() - 0;
  }
  bettypeStr = "" + bettypeStr;
  if(bettypeStr.indexOf("_") > 0){ var bettypeArr = bettypeStr.split("_"); }
  else{ var bettypeArr = [bettypeStr, 0]; }
  var bettype = bettypeArr[0];
  var subid = 0;
  if(bettypeArr.length > 1){ subid = bettypeArr[1]; }  
  
    urlPre = "op.php?op=member_3d&fp=bet_fast&gametype="+_gametype+"&palygroup="+palygroup+"&bettype="+bettype+"&disk="+disk+ "&subid=" + subid;
    for(i = 0; i < dataLen; i++){
    if(rdata.rates[i] == undefined){rdata.rates[i] = 0;}
    hrefStr = urlPre + "&num=" + rdata.number[i] + "&rate=" + rdata.rates[i];
    $(tbd+" td#td_r" + (bettype - r2aType) + "_" + rdata.number[i]).html('<a href="'+hrefStr+'" class=\"betRateNum\" target=\"leftFrame\">'+ rdata.rates[i] +'</a>');}
    
};

// show teable data two face without fast bet
$.fn.showTabelDataTwoFaceNoFast = function(rdata,tbdId,disk,_gametype,palygroup,bettype){
  var dataLen = rdata.number.length;
  var tbd = "table#" + tbdId;
    for(i = 0; i < dataLen; i++){
    $(tbd+" td#td_r" + bettype + "_" + rdata.number[i]).html('<span class=\"betRateNum\">'+ rdata.rates[i] +'</span>');}
    
};


// chg css background color
$.fn.chgBckColor = function(){
  $(this).css({'background-color':'#ffff8c'});
}

$.fn.disBckColor = function(){
  $(this).css({'background-color':''});
}